package com.mi.minal.module.system.controller;

import com.mi.rule.resource.ResC;
import com.mi.rule.resource.ResM;
import com.mi.rule.util.project.SRS;
import com.mi.minal.module.system.service.impl.SystemServiceImpl;
import com.mi.minal.mybatis.entity.SysResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ResC(value = "资源管理", parent = "系统管理")
@RestController
@RequestMapping("/system/resource")
public class ResourceController {
    @Autowired
    SystemServiceImpl systemService;

    @ResM("修改数据")
    @RequestMapping({"/update"})
    public SRS update(@RequestBody SysResource resource) {
        return systemService.updateResource(resource);
    }


    @ResM("分页查询")
    @RequestMapping("/page")
    public SRS page(@RequestBody SRS param) {
        return systemService.pageResource(param);
    }


    @ResM("列表查询")
    @RequestMapping({"/list"})
    public SRS list(@RequestBody SRS param) {
        return systemService.listResource(param);
    }


    @ResM("详情查询")
    @RequestMapping("/info")
    public SRS one(@RequestBody SRS param) {
        return systemService.infoResource(param);
    }
}
